home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-14 | 36.2 KB | 1,456 lines |
- head 5.16;
- branch 5.16.0;
- access;
- symbols
- RELEASE:5.16.0.23
- BETA:5.16.0.21
- UICSO:5.16.0
- VANILLA:5.16;
- locks; strict;
- comment @ * @;
-
-
- 5.16
- date 90.06.20.08.39.46; author paul; state Exp;
- branches
- 5.16.0.1;
- next ;
-
- 5.16.0.1
- date 90.06.20.09.41.10; author paul; state Exp;
- branches;
- next 5.16.0.2;
-
- 5.16.0.2
- date 90.06.25.09.21.08; author paul; state Exp;
- branches;
- next 5.16.0.3;
-
- 5.16.0.3
- date 90.09.20.17.06.44; author paul; state Exp;
- branches;
- next 5.16.0.4;
-
- 5.16.0.4
- date 90.09.22.18.46.35; author paul; state Exp;
- branches;
- next 5.16.0.5;
-
- 5.16.0.5
- date 90.10.13.17.25.18; author paul; state Exp;
- branches;
- next 5.16.0.6;
-
- 5.16.0.6
- date 90.10.15.13.49.52; author paul; state Exp;
- branches;
- next 5.16.0.7;
-
- 5.16.0.7
- date 90.11.13.15.26.11; author paul; state Exp;
- branches;
- next 5.16.0.8;
-
- 5.16.0.8
- date 90.11.24.17.13.10; author paul; state Exp;
- branches;
- next 5.16.0.9;
-
- 5.16.0.9
- date 90.11.29.21.17.16; author paul; state Exp;
- branches;
- next 5.16.0.10;
-
- 5.16.0.10
- date 90.12.13.21.29.54; author paul; state Exp;
- branches;
- next 5.16.0.11;
-
- 5.16.0.11
- date 91.03.04.21.48.23; author paul; state Exp;
- branches;
- next 5.16.0.12;
-
- 5.16.0.12
- date 91.03.26.18.03.19; author paul; state Exp;
- branches;
- next 5.16.0.13;
-
- 5.16.0.13
- date 91.04.02.23.20.21; author paul; state Exp;
- branches;
- next 5.16.0.14;
-
- 5.16.0.14
- date 91.04.05.06.33.33; author paul; state Exp;
- branches;
- next 5.16.0.15;
-
- 5.16.0.15
- date 91.04.05.14.55.15; author paul; state Exp;
- branches;
- next 5.16.0.16;
-
- 5.16.0.16
- date 91.05.18.03.23.51; author paul; state Exp;
- branches;
- next 5.16.0.17;
-
- 5.16.0.17
- date 91.05.20.02.52.59; author paul; state Exp;
- branches;
- next 5.16.0.18;
-
- 5.16.0.18
- date 91.05.22.02.30.43; author paul; state Exp;
- branches;
- next 5.16.0.19;
-
- 5.16.0.19
- date 91.05.23.21.41.27; author paul; state Exp;
- branches;
- next 5.16.0.20;
-
- 5.16.0.20
- date 91.05.29.05.17.07; author paul; state Exp;
- branches;
- next 5.16.0.21;
-
- 5.16.0.21
- date 91.06.01.04.05.01; author paul; state Exp;
- branches;
- next 5.16.0.22;
-
- 5.16.0.22
- date 91.06.05.02.20.56; author paul; state Exp;
- branches;
- next 5.16.0.23;
-
- 5.16.0.23
- date 91.06.24.16.23.29; author paul; state Exp;
- branches;
- next 5.16.0.24;
-
- 5.16.0.24
- date 91.08.14.18.28.19; author paul; state Exp;
- branches;
- next ;
-
-
- desc
- @@
-
-
-
- 5.16
- log
- @5.64 Berkeley release
- @
- text
- @/*
- * Copyright (c) 1983 Eric P. Allman
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted provided
- * that: (1) source distributions retain this entire copyright notice and
- * comment, and (2) distributions including binaries display the following
- * acknowledgement: ``This product includes software developed by the
- * University of California, Berkeley and its contributors'' in the
- * documentation or other materials provided with the distribution and in
- * all advertising materials mentioning features or use of this software.
- * Neither the name of the University nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @@(#)sendmail.h 5.16 (Berkeley) 6/1/90
- */
-
- /*
- ** SENDMAIL.H -- Global definitions for sendmail.
- */
-
- # ifdef _DEFINE
- # define EXTERN
- # ifndef lint
- static char SmailSccsId[] = "@@(#)sendmail.h 5.16 6/1/90";
- # endif lint
- # else _DEFINE
- # define EXTERN extern
- # endif _DEFINE
-
- # include <stdio.h>
- # include <ctype.h>
- # include <setjmp.h>
- # include "conf.h"
- # include "useful.h"
-
- # ifdef LOG
- # include <sys/syslog.h>
- # endif LOG
-
- # ifdef DAEMON
- # ifdef VMUNIX
- # include <sys/socket.h>
- # include <netinet/in.h>
- # endif VMUNIX
- # endif DAEMON
-
-
- # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */
-
-
- /*
- ** Data structure for bit maps.
- **
- ** Each bit in this map can be referenced by an ascii character.
- ** This is 128 possible bits, or 12 8-bit bytes.
- */
-
- #define BITMAPBYTES 16 /* number of bytes in a bit map */
- #define BYTEBITS 8 /* number of bits in a byte */
-
- /* internal macros */
- #define _BITWORD(bit) (bit / (BYTEBITS * sizeof (int)))
- #define _BITBIT(bit) (1 << (bit % (BYTEBITS * sizeof (int))))
-
- typedef int BITMAP[BITMAPBYTES / sizeof (int)];
-
- /* test bit number N */
- #define bitnset(bit, map) ((map)[_BITWORD(bit)] & _BITBIT(bit))
-
- /* set bit number N */
- #define setbitn(bit, map) (map)[_BITWORD(bit)] |= _BITBIT(bit)
-
- /* clear bit number N */
- #define clrbitn(bit, map) (map)[_BITWORD(bit)] &= ~_BITBIT(bit)
-
- /* clear an entire bit map */
- #define clrbitmap(map) bzero((char *) map, BITMAPBYTES)
- /*
- ** Address structure.
- ** Addresses are stored internally in this structure.
- */
-
- struct address
- {
- char *q_paddr; /* the printname for the address */
- char *q_user; /* user name */
- char *q_ruser; /* real user name, or NULL if q_user */
- char *q_host; /* host name */
- struct mailer *q_mailer; /* mailer to use */
- u_short q_flags; /* status flags, see below */
- short q_uid; /* user-id of receiver (if known) */
- short q_gid; /* group-id of receiver (if known) */
- char *q_home; /* home dir (local mailer only) */
- char *q_fullname; /* full name if known */
- struct address *q_next; /* chain */
- struct address *q_alias; /* address this results from */
- struct address *q_tchain; /* temporary use chain */
- time_t q_timeout; /* timeout for this address */
- };
-
- typedef struct address ADDRESS;
-
- # define QDONTSEND 000001 /* don't send to this address */
- # define QBADADDR 000002 /* this address is verified bad */
- # define QGOODUID 000004 /* the q_uid q_gid fields are good */
- # define QPRIMARY 000010 /* set from argv */
- # define QQUEUEUP 000020 /* queue for later transmission */
- /*
- ** Mailer definition structure.
- ** Every mailer known to the system is declared in this
- ** structure. It defines the pathname of the mailer, some
- ** flags associated with it, and the argument vector to
- ** pass to it. The flags are defined in conf.c
- **
- ** The argument vector is expanded before actual use. All
- ** words except the first are passed through the macro
- ** processor.
- */
-
- struct mailer
- {
- char *m_name; /* symbolic name of this mailer */
- char *m_mailer; /* pathname of the mailer to use */
- BITMAP m_flags; /* status flags, see below */
- short m_mno; /* mailer number internally */
- char **m_argv; /* template argument vector */
- short m_s_rwset; /* rewriting set for sender addresses */
- short m_r_rwset; /* rewriting set for recipient addresses */
- char *m_eol; /* end of line string */
- long m_maxsize; /* size limit on message to this mailer */
- };
-
- typedef struct mailer MAILER;
-
- /* bits for m_flags */
- # define M_CANONICAL 'C' /* make addresses canonical "u@@dom" */
- # define M_EXPENSIVE 'e' /* it costs to use this mailer.... */
- # define M_ESCFROM 'E' /* escape From lines to >From */
- # define M_FOPT 'f' /* mailer takes picky -f flag */
- # define M_HST_UPPER 'h' /* preserve host case distinction */
- # define M_INTERNAL 'I' /* SMTP to another sendmail site */
- # define M_LOCAL 'l' /* delivery is to this host */
- # define M_LIMITS 'L' /* must enforce SMTP line limits */
- # define M_MUSER 'm' /* can handle multiple users at once */
- # define M_NHDR 'n' /* don't insert From line */
- # define M_FROMPATH 'p' /* use reverse-path in MAIL FROM: */
- # define M_ROPT 'r' /* mailer takes picky -r flag */
- # define M_SECURE_PORT 'R' /* try to send on a reserved TCP port */
- # define M_STRIPQ 's' /* strip quote chars from user/host */
- # define M_RESTR 'S' /* must be daemon to execute */
- # define M_USR_UPPER 'u' /* preserve user case distinction */
- # define M_UGLYUUCP 'U' /* this wants an ugly UUCP from line */
- # define M_XDOT 'X' /* use hidden-dot algorithm */
-
- EXTERN MAILER *Mailer[MAXMAILERS+1];
-
- EXTERN MAILER *LocalMailer; /* ptr to local mailer */
- EXTERN MAILER *ProgMailer; /* ptr to program mailer */
- /*
- ** Header structure.
- ** This structure is used internally to store header items.
- */
-
- struct header
- {
- char *h_field; /* the name of the field */
- char *h_value; /* the value of that field */
- struct header *h_link; /* the next header */
- u_short h_flags; /* status bits, see below */
- BITMAP h_mflags; /* m_flags bits needed */
- };
-
- typedef struct header HDR;
-
- /*
- ** Header information structure.
- ** Defined in conf.c, this struct declares the header fields
- ** that have some magic meaning.
- */
-
- struct hdrinfo
- {
- char *hi_field; /* the name of the field */
- u_short hi_flags; /* status bits, see below */
- };
-
- extern struct hdrinfo HdrInfo[];
-
- /* bits for h_flags and hi_flags */
- # define H_EOH 00001 /* this field terminates header */
- # define H_RCPT 00002 /* contains recipient addresses */
- # define H_DEFAULT 00004 /* if another value is found, drop this */
- # define H_RESENT 00010 /* this address is a "Resent-..." address */
- # define H_CHECK 00020 /* check h_mflags against m_flags */
- # define H_ACHECK 00040 /* ditto, but always (not just default) */
- # define H_FORCE 00100 /* force this field, even if default */
- # define H_TRACE 00200 /* this field contains trace information */
- # define H_FROM 00400 /* this is a from-type field */
- # define H_VALID 01000 /* this field has a validated value */
- /*
- ** Envelope structure.
- ** This structure defines the message itself. There is usually
- ** only one of these -- for the message that we originally read
- ** and which is our primary interest -- but other envelopes can
- ** be generated during processing. For example, error messages
- ** will have their own envelope.
- */
-
- struct envelope
- {
- HDR *e_header; /* head of header list */
- long e_msgpriority; /* adjusted priority of this message */
- time_t e_ctime; /* time message appeared in the queue */
- char *e_to; /* the target person */
- char *e_receiptto; /* return receipt address */
- ADDRESS e_from; /* the person it is from */
- char **e_fromdomain; /* the domain part of the sender */
- ADDRESS *e_sendqueue; /* list of message recipients */
- ADDRESS *e_errorqueue; /* the queue for error responses */
- long e_msgsize; /* size of the message in bytes */
- int e_nrcpts; /* number of recipients */
- short e_class; /* msg class (priority, junk, etc.) */
- short e_flags; /* flags, see below */
- short e_hopcount; /* number of times processed */
- int (*e_puthdr)(); /* function to put header of message */
- int (*e_putbody)(); /* function to put body of message */
- struct envelope *e_parent; /* the message this one encloses */
- struct envelope *e_sibling; /* the next envelope of interest */
- char *e_df; /* location of temp file */
- FILE *e_dfp; /* temporary file */
- char *e_id; /* code for this entry in queue */
- FILE *e_xfp; /* transcript file */
- char *e_message; /* error message */
- char *e_macro[128]; /* macro definitions */
- };
-
- typedef struct envelope ENVELOPE;
-
- /* values for e_flags */
- #define EF_OLDSTYLE 000001 /* use spaces (not commas) in hdrs */
- #define EF_INQUEUE 000002 /* this message is fully queued */
- #define EF_TIMEOUT 000004 /* this message is too old */
- #define EF_CLRQUEUE 000010 /* disk copy is no longer needed */
- #define EF_SENDRECEIPT 000020 /* send a return receipt */
- #define EF_FATALERRS 000040 /* fatal errors occured */
- #define EF_KEEPQUEUE 000100 /* keep queue files always */
- #define EF_RESPONSE 000200 /* this is an error or return receipt */
- #define EF_RESENT 000400 /* this message is being forwarded */
-
- EXTERN ENVELOPE *CurEnv; /* envelope currently being processed */
- /*
- ** Message priority classes.
- **
- ** The message class is read directly from the Priority: header
- ** field in the message.
- **
- ** CurEnv->e_msgpriority is the number of bytes in the message plus
- ** the creation time (so that jobs ``tend'' to be ordered correctly),
- ** adjusted by the message class, the number of recipients, and the
- ** amount of time the message has been sitting around. This number
- ** is used to order the queue. Higher values mean LOWER priority.
- **
- ** Each priority class point is worth WkClassFact priority points;
- ** each recipient is worth WkRecipFact priority points. Each time
- ** we reprocess a message the priority is adjusted by WkTimeFact.
- ** WkTimeFact should normally decrease the priority so that jobs
- ** that have historically failed will be run later; thanks go to
- ** Jay Lepreau at Utah for pointing out the error in my thinking.
- **
- ** The "class" is this number, unadjusted by the age or size of
- ** this message. Classes with negative representations will have
- ** error messages thrown away if they are not local.
- */
-
- struct priority
- {
- char *pri_name; /* external name of priority */
- int pri_val; /* internal value for same */
- };
-
- EXTERN struct priority Priorities[MAXPRIORITIES];
- EXTERN int NumPriorities; /* pointer into Priorities */
- /*
- ** Rewrite rules.
- */
-
- struct rewrite
- {
- char **r_lhs; /* pattern match */
- char **r_rhs; /* substitution value */
- struct rewrite *r_next;/* next in chain */
- };
-
- EXTERN struct rewrite *RewriteRules[MAXRWSETS];
-
- /*
- ** Special characters in rewriting rules.
- ** These are used internally only.
- ** The COND* rules are actually used in macros rather than in
- ** rewriting rules, but are given here because they
- ** cannot conflict.
- */
-
- /* left hand side items */
- # define MATCHZANY '\020' /* match zero or more tokens */
- # define MATCHANY '\021' /* match one or more tokens */
- # define MATCHONE '\022' /* match exactly one token */
- # define MATCHCLASS '\023' /* match one token in a class */
- # define MATCHNCLASS '\024' /* match anything not in class */
- # define MATCHREPL '\025' /* replacement on RHS for above */
-
- /* right hand side items */
- # define CANONNET '\026' /* canonical net, next token */
- # define CANONHOST '\027' /* canonical host, next token */
- # define CANONUSER '\030' /* canonical user, next N tokens */
- # define CALLSUBR '\031' /* call another rewriting set */
-
- /* conditionals in macros */
- # define CONDIF '\032' /* conditional if-then */
- # define CONDELSE '\033' /* conditional else */
- # define CONDFI '\034' /* conditional fi */
-
- /* bracket characters for host name lookup */
- # define HOSTBEGIN '\035' /* hostname lookup begin */
- # define HOSTEND '\036' /* hostname lookup end */
-
- /* \001 is also reserved as the macro expansion character */
- /*
- ** Information about hosts that we have looked up recently.
- **
- ** This stuff is 4.2/3bsd specific.
- */
-
- # ifdef DAEMON
- # ifdef VMUNIX
-
- # define HOSTINFO struct hostinfo
-
- HOSTINFO
- {
- char *ho_name; /* name of this host */
- struct in_addr ho_inaddr; /* internet address */
- short ho_flags; /* flag bits, see below */
- short ho_errno; /* error number on last connection */
- short ho_exitstat; /* exit status from last connection */
- };
-
-
- /* flag bits */
- #define HOF_VALID 00001 /* this entry is valid */
-
- # endif VMUNIX
- # endif DAEMON
- /*
- ** Symbol table definitions
- */
-
- struct symtab
- {
- char *s_name; /* name to be entered */
- char s_type; /* general type (see below) */
- struct symtab *s_next; /* pointer to next in chain */
- union
- {
- BITMAP sv_class; /* bit-map of word classes */
- ADDRESS *sv_addr; /* pointer to address header */
- MAILER *sv_mailer; /* pointer to mailer */
- char *sv_alias; /* alias */
- # ifdef HOSTINFO
- HOSTINFO sv_host; /* host information */
- # endif HOSTINFO
- } s_value;
- };
-
- typedef struct symtab STAB;
-
- /* symbol types */
- # define ST_UNDEF 0 /* undefined type */
- # define ST_CLASS 1 /* class map */
- # define ST_ADDRESS 2 /* an address in parsed format */
- # define ST_MAILER 3 /* a mailer header */
- # define ST_ALIAS 4 /* an alias */
- # define ST_HOST 5 /* host information */
-
- # define s_class s_value.sv_class
- # define s_address s_value.sv_addr
- # define s_mailer s_value.sv_mailer
- # define s_alias s_value.sv_alias
- # define s_host s_value.sv_host
-
- extern STAB *stab();
-
- /* opcodes to stab */
- # define ST_FIND 0 /* find entry */
- # define ST_ENTER 1 /* enter if not there */
- /*
- ** STRUCT EVENT -- event queue.
- **
- ** Maintained in sorted order.
- **
- ** We store the pid of the process that set this event to insure
- ** that when we fork we will not take events intended for the parent.
- */
-
- struct event
- {
- time_t ev_time; /* time of the function call */
- int (*ev_func)(); /* function to call */
- int ev_arg; /* argument to ev_func */
- int ev_pid; /* pid that set this event */
- struct event *ev_link; /* link to next item */
- };
-
- typedef struct event EVENT;
-
- EXTERN EVENT *EventQueue; /* head of event queue */
- /*
- ** Operation, send, and error modes
- **
- ** The operation mode describes the basic operation of sendmail.
- ** This can be set from the command line, and is "send mail" by
- ** default.
- **
- ** The send mode tells how to send mail. It can be set in the
- ** configuration file. It's setting determines how quickly the
- ** mail will be delivered versus the load on your system. If the
- ** -v (verbose) flag is given, it will be forced to SM_DELIVER
- ** mode.
- **
- ** The error mode tells how to return errors.
- */
-
- EXTERN char OpMode; /* operation mode, see below */
-
- #define MD_DELIVER 'm' /* be a mail sender */
- #define MD_ARPAFTP 'a' /* old-style arpanet protocols */
- #define MD_SMTP 's' /* run SMTP on standard input */
- #define MD_DAEMON 'd' /* run as a daemon */
- #define MD_VERIFY 'v' /* verify: don't collect or deliver */
- #define MD_TEST 't' /* test mode: resolve addrs only */
- #define MD_INITALIAS 'i' /* initialize alias database */
- #define MD_PRINT 'p' /* print the queue */
- #define MD_FREEZE 'z' /* freeze the configuration file */
-
-
- EXTERN char SendMode; /* send mode, see below */
-
- #define SM_DELIVER 'i' /* interactive delivery */
- #define SM_QUICKD 'j' /* deliver w/o queueing */
- #define SM_FORK 'b' /* deliver in background */
- #define SM_QUEUE 'q' /* queue, don't deliver */
- #define SM_VERIFY 'v' /* verify only (used internally) */
-
- /* used only as a parameter to sendall */
- #define SM_DEFAULT '\0' /* unspecified, use SendMode */
-
-
- EXTERN char ErrorMode; /* error mode, see below */
-
- #define EM_PRINT 'p' /* print errors */
- #define EM_MAIL 'm' /* mail back errors */
- #define EM_WRITE 'w' /* write back errors */
- #define EM_BERKNET 'e' /* special berknet processing */
- #define EM_QUIET 'q' /* don't print messages (stat only) */
-
- /* offset used to issure that the error messages for name server error
- * codes are unique.
- */
- #define MAX_ERRNO 100
- /*
- ** Global variables.
- */
-
- EXTERN bool FromFlag; /* if set, "From" person is explicit */
- EXTERN bool NoAlias; /* if set, don't do any aliasing */
- EXTERN bool ForceMail; /* if set, mail even if already got a copy */
- EXTERN bool MeToo; /* send to the sender also */
- EXTERN bool IgnrDot; /* don't let dot end messages */
- EXTERN bool SaveFrom; /* save leading "From" lines */
- EXTERN bool Verbose; /* set if blow-by-blow desired */
- EXTERN bool GrabTo; /* if set, get recipients from msg */
- EXTERN bool NoReturn; /* don't return letter to sender */
- EXTERN bool SuprErrs; /* set if we are suppressing errors */
- EXTERN bool QueueRun; /* currently running message from the queue */
- EXTERN bool HoldErrs; /* only output errors to transcript */
- EXTERN bool NoConnect; /* don't connect to non-local mailers */
- EXTERN bool SuperSafe; /* be extra careful, even if expensive */
- EXTERN bool ForkQueueRuns; /* fork for each job when running the queue */
- EXTERN bool AutoRebuild; /* auto-rebuild the alias database as needed */
- EXTERN bool CheckAliases; /* parse addresses during newaliases */
- EXTERN bool UseNameServer; /* use internet domain name server */
- EXTERN int SafeAlias; /* minutes to wait until @@:@@ in alias file */
- EXTERN time_t TimeOut; /* time until timeout */
- EXTERN FILE *InChannel; /* input connection */
- EXTERN FILE *OutChannel; /* output connection */
- EXTERN int RealUid; /* when Daemon, real uid of caller */
- EXTERN int RealGid; /* when Daemon, real gid of caller */
- EXTERN int DefUid; /* default uid to run as */
- EXTERN char *DefUser; /* default user to run as (from DefUid) */
- EXTERN int DefGid; /* default gid to run as */
- EXTERN int OldUmask; /* umask when sendmail starts up */
- EXTERN int Errors; /* set if errors (local to single pass) */
- EXTERN int ExitStat; /* exit status code */
- EXTERN int AliasLevel; /* depth of aliasing */
- EXTERN int MotherPid; /* proc id of parent process */
- EXTERN int LineNumber; /* line number in current input */
- EXTERN time_t ReadTimeout; /* timeout on reads */
- EXTERN int LogLevel; /* level of logging to perform */
- EXTERN int FileMode; /* mode on files */
- EXTERN int QueueLA; /* load average starting forced queueing */
- EXTERN int RefuseLA; /* load average refusing connections are */
- EXTERN int QueueFactor; /* slope of queue function */
- EXTERN time_t QueueIntvl; /* intervals between running the queue */
- EXTERN char *AliasFile; /* location of alias file */
- EXTERN char *HelpFile; /* location of SMTP help file */
- EXTERN char *StatFile; /* location of statistics summary */
- EXTERN char *QueueDir; /* location of queue directory */
- EXTERN char *FileName; /* name to print on error messages */
- EXTERN char *SmtpPhase; /* current phase in SMTP processing */
- EXTERN char *MyHostName; /* name of this host for SMTP messages */
- EXTERN char *RealHostName; /* name of host we are talking to */
- EXTERN struct sockaddr_in RealHostAddr;/* address of host we are talking to */
- EXTERN char *CurHostName; /* current host we are dealing with */
- EXTERN jmp_buf TopFrame; /* branch-to-top-of-loop-on-error frame */
- EXTERN bool QuickAbort; /* .... but only if we want a quick abort */
- extern char *ConfFile; /* location of configuration file [conf.c] */
- extern char *FreezeFile; /* location of frozen memory image [conf.c] */
- extern char Arpa_Info[]; /* the reply code for Arpanet info [conf.c] */
- extern ADDRESS NullAddress; /* a null (template) address [main.c] */
- EXTERN char SpaceSub; /* substitution for <lwsp> */
- EXTERN int WkClassFact; /* multiplier for message class -> priority */
- EXTERN int WkRecipFact; /* multiplier for # of recipients -> priority */
- EXTERN int WkTimeFact; /* priority offset each time this job is run */
- EXTERN int CheckPointLimit; /* deliveries before checkpointing */
- EXTERN int Nmx; /* number of MX RRs */
- EXTERN char *PostMasterCopy; /* address to get errs cc's */
- EXTERN char *MxHosts[MAXMXHOSTS+1]; /* for MX RRs */
- EXTERN char *TrustedUsers[MAXTRUST+1]; /* list of trusted users */
- EXTERN char *UserEnviron[MAXUSERENVIRON+1]; /* saved user environment */
- /*
- ** Trace information
- */
-
- /* trace vector and macros for debugging flags */
- EXTERN u_char tTdvect[100];
- # define tTd(flag, level) (tTdvect[flag] >= level)
- # define tTdlevel(flag) (tTdvect[flag])
- /*
- ** Miscellaneous information.
- */
-
- # include <sysexits.h>
-
-
- /*
- ** Some in-line functions
- */
-
- /* set exit status */
- #define setstat(s) { \
- if (ExitStat == EX_OK || ExitStat == EX_TEMPFAIL) \
- ExitStat = s; \
- }
-
- /* make a copy of a string */
- #define newstr(s) strcpy(xalloc(strlen(s) + 1), s)
-
- #define STRUCTCOPY(s, d) d = s
-
-
- /*
- ** Declarations of useful functions
- */
-
- extern ADDRESS *parseaddr();
- extern char *xalloc();
- extern bool sameaddr();
- extern FILE *dfopen();
- extern EVENT *setevent();
- extern char *sfgets();
- extern char *queuename();
- extern time_t curtime();
- @
-
-
- 5.16.0.1
- log
- @IDA patches
- @
- text
- @a38 1
- # include <sysexits.h>
- d133 2
- a134 4
- short m_se_rwset; /* rewriting ruleset for envelope senders */
- short m_sh_rwset; /* rewriting ruleset for header senders */
- short m_re_rwset; /* rewriting ruleset for envelope recipients */
- short m_rh_rwset; /* rewriting ruleset for header recipient */
- a141 1
- # define M_BSMTP 'B' /* don't wait for SMTP responses */
- a158 1
- # define M_RELATIVIZE 'V' /* !-relativize all addresses */
- a255 3
- /* special shadowing null for e_macro's */
- #define MACNULL ((char *) 1) /* don't check parent's value */
-
- d329 1
- a329 1
- /* bracket characters for host name & database keyed lookup */
- a331 2
- # define KEYBEGIN '\037' /* keyed lookup begin */
- # define KEYEND '\017' /* keyed lookup end */
- a332 4
- /* other miscellaneous */
- # define MACVALUE '\016' /* delayed macro expansion $& */
- # define QUOTE822 '\015' /* quote next macro if RFC822 requires it */
-
- a390 5
- /* s_host is defined is /usr/include/whatever on Suns */
- # ifdef s_host
- # undef s_host
- # endif
-
- a452 1
- #define MD_BSMTP 'b' /* batched smtp mode */
- a476 48
- ** Database ([n]dbm) definitions.
- */
-
- #ifdef DBM
-
- typedef struct {
- char *dptr;
- int dsize;
- } DATUM;
-
- # define DB_DIREXT ".dir"
- # define DB_PAGEXT ".pag"
-
- # if defined(NDBM) && defined(SDBM)
- BOTH_NDBM_AND_SDBM_DEFINED;
- # endif NDBM && SDBM
-
- # if defined(NDBM) || defined(SDBM)
- # undef DBM /* while including ndbm.h */
- # ifdef NDBM
- # include <ndbm.h> /* DBM is typedef'ed here */
- # else
- # include <sdbm.h> /* DBM is typedef'ed here */
- # endif NDBM
- typedef DBM DBMFILE; /* move typedef to DBMFILE */
- # define DBM /* and restore DBM definition */
- # ifndef gould
- # include <fcntl.h> /* needed for dbm_open */
- # endif gould
-
- # define DATUM datum /* use the definition in ndbm.h */
-
- struct dbm_table {
- char *db_name; /* database file name */
- time_t db_mtime; /* last modify time */
- DBMFILE *db_dbm; /* dbm file descriptor */
- };
-
- # define DB_NOSUCHFILE ((DBMFILE *) 0) /* file could not be found */
- # define DB_NOTYETOPEN ((DBMFILE *) -1) /* file has not yet been opened */
-
- # define DB_ALIAS '@@' /* "name" of aliases database */
- # define AliasFile DbmTab[DB_ALIAS].db_name
- # define AliasDbm DbmTab[DB_ALIAS].db_dbm
-
- # endif NDBM || SDBM
- #endif DBM
- /*
- a519 1
- #if !defined(NDBM) && !defined(SDBM)
- a520 1
- #endif !NDBM && !SDBM
- a542 1
- EXTERN bool SplitRewriting; /* use split envelope/header rewriting */
- a548 6
- #if defined(NDBM) || defined(SDBM)
- EXTERN struct dbm_table DbmTab[128]; /* keyed database table */
- #ifdef YP
- #define YPMARK '%' /* yellow pages indicator */
- #endif YP
- #endif NDBM || SDBM
- d558 3
- a588 12
-
- /*
- ** Metamacro definitions.
- */
-
- struct metamac
- {
- char metaname;
- char metaval;
- };
-
- extern struct metamac MetaMacros[];
- @
-
-
- 5.16.0.2
- log
- @Patches for HP-UX from Andy Linton <root@@comp.vuw.ac.nz>. Thanks Andy!
- @
- text
- @a42 4
- # if defined(hpux)
- # include "flock.h"
- # endif /* hpux */
-
- a43 3
- # if defined(hpux)
- # include <syslog.h>
- # else
- a44 1
- # endif /* hpux */
- @
-
-
- 5.16.0.3
- log
- @First revisions to support HEAD and MULT extensions to SMTP for DEC's
- mail11v3 program.
-
- @
- text
- @a172 4
- # ifdef MAIL11V3
- # define M_PREHEAD 'H' /* preview headers */
- # define M_MANYSTATUS 'M' /* mailer returns multi-status for DATA cmd */
- # endif /* MAIL11V3 */
- a573 3
- # ifdef MAIL11V3
- EXTERN bool SmtpManyStatus; /* receive multiple status' from DATA cmd */
- # endif /* MAIL11V3 */
- @
-
-
- 5.16.0.4
- log
- @Picked wrong value for M_MANYSTATUS.
- @
- text
- @d175 1
- a175 1
- # define M_MANYSTATUS 'N' /* mailer returns multi-status for DATA cmd */
- @
-
-
- 5.16.0.5
- log
- @Re-did indentation of # statements. Test for #include "flock.h" moved to
- alias.c, daemon.c, and queue.c. Protect m_flags with an #undef m_flags
- on HP-UX. Added GDBM support.
- @
- text
- @d28 2
- a29 2
- # define EXTERN
- # ifndef lint
- d31 4
- a34 4
- # endif /* lint */
- # else /* !_DEFINE */
- # define EXTERN extern
- # endif /* _DEFINE */
- d43 4
- d48 6
- a53 6
- # if defined(hpux)
- # include <syslog.h>
- # else /* !hpux */
- # include <sys/syslog.h>
- # endif /* hpux */
- # endif /* LOG */
- d56 5
- a60 5
- # ifdef VMUNIX
- # include <sys/socket.h>
- # include <netinet/in.h>
- # endif /* VMUNIX */
- # endif /* DAEMON */
- a61 3
- # ifdef VSPRINTF
- # include <varargs.h>
- # endif /* VSPRINTF */
- d70 1
- a70 1
- ** This is 128 possible bits, or 16 8-bit bytes.
- d80 1
- a80 1
- typedef unsigned int BITMAP[BITMAPBYTES / sizeof (int)];
- a134 5
- /* m_flags is a #define in <include/sysmacros.h under HP-UX */
- #ifdef m_flags
- # undef m_flags
- #endif /* m_flags */
-
- d367 1
- a367 1
- # ifdef VMUNIX
- d369 1
- a369 1
- # define HOSTINFO struct hostinfo
- d382 1
- a382 1
- # define HOF_VALID 00001 /* this entry is valid */
- d384 2
- a385 2
- # endif /* VMUNIX */
- # endif /* DAEMON */
- d403 1
- a403 1
- # endif /* HOSTINFO */
- d420 1
- a420 1
- # endif /* s_host */
- d517 1
- a517 1
- } XDATUM;
- d522 3
- a524 3
- # ifdef GDBM
- # define OTHERDBM
- # endif /* GDBM */
- d526 1
- a526 13
- # ifdef SDBM
- # ifdef OTHERDBM
- MULTIPLE_DBM_TYPES_DEFINED
- # else
- # define OTHERDBM
- # endif /* OTHERDBM */
- # endif /* SDBM */
-
- # if defined(NDBM) && defined(OTHERDBM)
- MULTIPLE_DBM_TYPES_DEFINED
- # endif /* NDBM && OTHERDBM */
-
- # if defined(NDBM) || defined(OTHERDBM)
- a527 3
- # ifdef GDBM
- # include <ndbm.h> /* DBM is typedef'ed here */
- # endif /* GDBM */
- d530 1
- a530 2
- # endif /* NDBM */
- # ifdef SDBM
- d532 1
- a532 1
- # endif /* SDBM */
- d537 1
- a537 1
- # endif /* gould */
- d539 1
- a539 1
- # define XDATUM datum /* use the definition in ndbm.h */
- d547 2
- a548 2
- # define DB_NOSUCHFILE ((DBMFILE *) 0) /* file could not be found */
- # define DB_NOTYETOPEN ((DBMFILE *) -1) /* file has not yet been opened */
- d550 3
- a552 3
- # define DB_ALIAS '@@' /* "name" of aliases database */
- # define AliasFile DbmTab[DB_ALIAS].db_name
- # define AliasDbm DbmTab[DB_ALIAS].db_dbm
- d554 2
- a555 2
- # endif /* NDBM || OTHERDBM */
- #endif /* DBM */
- a587 3
- #if defined(__convex__) && defined(SHARE)
- EXTERN int DefShareUid; /* default share uid to assign process to */
- #endif /* __convex__ && SHARE */
- d603 1
- a603 1
- #if !defined(NDBM) && !defined(OTHERDBM)
- d605 1
- a605 1
- #endif /* !NDBM && !OTHERDBM */
- d635 1
- a635 1
- #if defined(NDBM) || defined(OTHERDBM)
- d637 4
- a640 4
- # ifdef YP
- # define YPMARK '%' /* yellow pages indicator */
- # endif /* YP */
- #endif /* NDBM || OTHERDBM */
- @
-
-
- 5.16.0.6
- log
- @Added MDBM conditionals.
- @
- text
- @d523 2
- a524 4
- # ifndef MDBM
- # define DB_DIREXT ".dir"
- # define DB_PAGEXT ".pag"
- # endif /* !MDBM */
- a537 8
- # ifdef MDBM
- # ifdef OTHERDBM
- MULTIPLE_DBM_TYPES_DEFINED
- # else
- # define OTHERDBM
- # endif /* OTHERDBM */
- # endif /* MDBM */
-
- a552 12
- # ifdef MDBM
- # include <mdbm.h> /* DBM *not* typedef'ed here */
- # define DB_DIREXT ".map"
- # define DB_PAGEXT ".dat"
- # define DBM_INSERT MDBM_INSERT
- # define DBM_REPLACE MDBM_REPLACE
- # define dbm_open(x,y,z) mdbm_open(x,y,z,(int *)0, (int *)0, (char *)0)
- # define dbm_close mdbm_close
- # define dbm_fetch mdbm_fetch
- # define dbm_store mdbm_store
- typedef struct mdbm DBMFILE;
- # else /* !MDBM */
- a553 1
- # endif /* MDBM */
- @
-
-
- 5.16.0.7
- log
- @Moved #include <sys/file.h> and test whether to #include "flock.h" for
- faking flock() from several *.c files to sendmail.h. Added # define XPG3
- (X-Open portability guide 3) for those systems that support it (hpux and
- DGUX for now). From Andy Linton (andy.linton@@comp.vuw.ac.nz).
- @
- text
- @a42 10
- # include <sys/file.h>
- # ifndef LOCK_EX
- # include "flock.h"
- # endif /* !LOCK_EX */
-
- # if defined(hpux) || defined(DGUX)
- # define XPG3 /* X-Open Portability Guide 3 */
- # include <unistd.h>
- # endif /* hpux || DGUX */
-
- @
-
-
- 5.16.0.8
- log
- @Convex changes to eliminate need for -pcc. Use <dirent.h> with XPG3.
- @
- text
- @d48 1
- a48 1
- # if defined(hpux) || defined(_CONVEX_SOURCE) || defined(DGUX)
- d51 1
- a51 5
- # ifndef direct
- # include <dirent.h>
- # define direct dirent
- # endif /* !direct */
- # endif /* hpux || _CONVEX_SOURCE || DGUX */
- @
-
-
- 5.16.0.9
- log
- @Deleted #ifdef/#define OUTPUT_PID in favor of testing whether _PATH_SENDMAILPID
- is set. sendmail.h now #include's pathnames.h instead of the other
- modules.
- @
- text
- @a39 1
- # include "pathnames.h"
- @
-
-
- 5.16.0.10
- log
- @Contents of pathnames.h folded into conf.h. See the comments there for
- more details.
- @
- text
- @d40 1
- @
-
-
- 5.16.0.11
- log
- @ANSIfied.
- @
- text
- @a35 2
- # include "conf.h"
- # include "useful.h"
- d40 2
- d266 2
- a267 2
- void (*e_puthdr)(); /* function to put header of message */
- void (*e_putbody)(); /* function to put body of message */
- d463 1
- a463 1
- void (*ev_func)(); /* function to call */
- d725 14
- a749 1
- # include "def.h"
- @
-
-
- 5.16.0.12
- log
- @UserEnviron made local to main.c.
- @
- text
- @d691 1
- @
-
-
- 5.16.0.13
- log
- @Now use stdarg.h rather than varargs.h when __STDC__ is true.
- @
- text
- @d37 1
- a38 1
- # include "useful.h"
- d73 1
- a73 5
- # if defined(__STDC__)
- # include <stdarg.h>
- # else /* !__STDC__ */
- # include <varargs.h>
- # endif /* __STDC__ */
- @
-
-
- 5.16.0.14
- log
- @Character set translation changes adapted from patches from Keld Simonsen
- (keld@@dkuug.dk).
- @
- text
- @a41 3
- # ifdef BIT8
- # include "../ida/charset/charset.h"
- # endif /* BIT8 */
- a169 4
- # ifdef BIT8
- CHARSET *m_charset; /* default character set */
- short m_esc; /* escape character */
- # endif /* BIT8 */
- d201 1
- a203 4
-
- # ifdef BIT8
- EXTERN CHARSET *ascii;
- # endif /* BIT8 */
- @
-
-
- 5.16.0.15
- log
- @Added RCS ID string
- @
- text
- @a30 1
- static char SmailRcsId[] = "@@(#)$Id$";
- @
-
-
- 5.16.0.16
- log
- @Added definition of INADD_NONE if #ifndef'ed (used in deliver.c). Have
- gdbm use .pag files like other normal DBM packages.
- @
- text
- @d30 2
- a31 2
- static char SmailSccsId[] = "@@(#)sendmail.h 5.16 6/1/90 %I% local";
- static char SmailRcsId[] = "@@(#)$Id: sendmail.h,v 5.16.0.15 1991/04/05 14:55:15 paul Exp paul $";
- a72 3
- # ifndef INADDR_NONE
- # define INADDR_NONE 0xffffffff
- # endif /* !INADDR_NONE */
- a558 2
- # undef DB_DIREXT
- # define DB_DIREXT ".pag"
- @
-
-
- 5.16.0.17
- log
- @Added DeclHostName for the host name offered in the SMTP HELO command.
- Printed in the Received: header if it differs from the real host name.
- @
- text
- @d31 1
- a31 1
- static char SmailRcsId[] = "@@(#)$Id: sendmail.h,v 5.16.0.16 1991/05/18 03:23:51 paul Exp paul $";
- a692 1
- EXTERN char *DeclHostName; /* declared name of host we are talking to */
- @
-
-
- 5.16.0.18
- log
- @Eliminated non-#define VSPRINT as a portable vsprintf() is now included
- in vprintf.c.
- @
- text
- @d31 1
- a31 1
- static char SmailRcsId[] = "@@(#)$Id: sendmail.h,v 5.16.0.17 1991/05/20 02:52:59 paul Exp paul $";
- d79 7
- a85 5
- # if defined(__STDC__)
- # include <stdarg.h>
- # else /* !__STDC__ */
- # include <varargs.h>
- # endif /* __STDC__ */
- @
-
-
- 5.16.0.19
- log
- @Further changes for Interactive Systems UNIX adapted from patches
- sent by Andy Linton <Andy.Linton@@comp.vuw.ac.nz>.
- @
- text
- @d31 1
- a31 1
- static char SmailRcsId[] = "@@(#)$Id: sendmail.h,v 5.16.0.18 1991/05/22 02:30:43 paul Exp paul $";
- a38 10
- # ifdef SYSV
- # include <signal.h>
- # else /* !SYSV */
- # include <sys/signal.h>
- # endif /* SYSV */
- # if defined(SYSV) || defined(_AIX)
- # include <time.h>
- # else /* !SYSV && !_AIX */
- # include <sys/time.h>
- # endif /* SYSV || _AIX */
- d46 1
- d62 1
- a62 1
- # if defined(hpux) || defined(ISC)
- d64 1
- a64 1
- # else /* !hpux && !ISC */
- d66 1
- a66 1
- # endif /* hpux || ISC */
- d70 1
- a70 1
- # if defined(VMUNIX) || defined(ISC)
- d76 1
- a76 1
- # endif /* VMUNIX || ISC */
- @
-
-
- 5.16.0.20
- log
- @Added support for autobuilding of dbm files (incomplete).
- @
- text
- @d31 1
- a31 1
- static char SmailRcsId[] = "@@(#)$Id: sendmail.h,v 5.16.0.19 1991/05/23 21:41:27 paul Exp paul $";
- a626 4
- # ifdef DBM_AUTOBUILD
- char *db_source; /* text file to remake dbm */
- char *db_rule; /* program path name or fscanf string */
- # else /* !DBM_AUTOBUILD */
- a627 1
- # endif /* !DBM_AUTOBUILD */
- a748 1
- #define dbm_newstr(s) strncpy(xalloc(s.dsize + 1), s.dptr, s.dsize)
- @
-
-
- 5.16.0.21
- log
- @Dropped tests for _AIX.
- @
- text
- @d31 1
- a31 1
- static char SmailRcsId[] = "@@(#)$Id: sendmail.h,v 5.16.0.20 1991/05/29 05:17:07 paul Exp paul $";
- d44 1
- a44 1
- # if defined(SYSV)
- d46 1
- a46 1
- # else /* !SYSV */
- d48 1
- a48 1
- # endif /* SYSV */
- @
-
-
- 5.16.0.22
- log
- @Fix handling of multi-line .forward files. From Eric Wassenaar
- (e07@@nikhefh.nikhef.nl)>
- @
- text
- @d31 1
- a31 1
- static char SmailRcsId[] = "@@(#)$Id: sendmail.h,v 5.16.0.21 1991/06/01 04:05:01 paul Exp paul $";
- a153 1
- # define QSELFREF 000040 /* self-reference in alias/forward expansion */
- @
-
-
- 5.16.0.23
- log
- @Now uses TIME_TYPE rather than time_t, added MATCHMAP/MATCHNMAP.
- @
- text
- @d30 2
- a31 2
- static char SmailSccsId[] = "@@(#)sendmail.h 5.16 6/1/90";
- static char SmailRcsId[] = "@@(#)$Id: sendmail.h,v 5.16.0.22 1991/06/05 02:20:56 paul Exp paul $";
- d78 9
- a86 7
- # if defined(VMUNIX) || defined(ISC)
- # include <sys/socket.h>
- # include <netinet/in.h>
- # ifndef INADDR_NONE
- # define INADDR_NONE 0xffffffff
- # endif /* !INADDR_NONE */
- # endif /* VMUNIX || ISC */
- d144 1
- a144 1
- TIME_TYPE q_timeout; /* timeout for this address */
- d280 1
- a280 1
- TIME_TYPE e_ctime; /* time message appeared in the queue */
- a380 2
- # define MATCHMAP '\013' /* found in dbm/map */
- # define MATCHNMAP '\014' /* not found in dbm/map */
- d488 1
- a488 1
- TIME_TYPE ev_time; /* time of the function call */
- d556 1
- a556 3
- #ifndef DBM
- # undef DBM_AUTOBUILD /* can't autobuild w/o DBM of some type */
- #else /* DBM */
- d632 1
- a632 1
- TIME_TYPE db_mtime; /* last modify time */
- d645 1
- a645 1
- #endif /* !DBM */
- d672 1
- a672 1
- EXTERN TIME_TYPE TimeOut; /* time until timeout */
- d689 1
- a689 1
- EXTERN TIME_TYPE ReadTimeout; /* timeout on reads */
- d695 1
- a695 1
- EXTERN TIME_TYPE QueueIntvl; /* intervals between running the queue */
- @
-
-
- 5.16.0.24
- log
- @Added support for the Berkeley hashing package ndbm replacement (HDBM).
- @
- text
- @d31 1
- a31 1
- static char SmailRcsId[] = "@@(#)$Id: sendmail.h,v 5.16.0.23 1991/06/24 16:23:29 paul Exp paul $";
- a591 8
- # ifdef HDBM
- # ifdef OTHERDBM
- MULTIPLE_DBM_TYPES_DEFINED
- # else
- # define OTHERDBM
- # endif /* OTHERDBM */
- # endif /* HDBM */
-
- a606 3
- # ifdef HDBM
- # include <ndbm.h> /* DBM is typedef'ed here */
- # endif /* HDBM */
- @
-